<!DOCTYPE html>
<html xmlns:wb="http://open.weibo.com/wb">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection" />
	<meta content="emai=no" name="format-detection" />
	<meta property="wb:webmaster" content="7ae117dc1d8992dc" />
	<title>啪啪蚊子大作战</title>
	<link href="/wenzi/css/common.css" rel="stylesheet" />
	<link href="/wenzi/css/game.css" rel="stylesheet" />
	<script src="/wenzi/js/zepto-1.1.6.js"></script>
	<script src="/wenzi/js/fastclick.js"></script>
	<script src="/wenzi/js/common.js"></script>
	<script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?19f39b206aedf768b42fbc69e4e4f721";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>
</head>
<body>
	<div id="wrapper">
		<audio id="BGM" loop="loop" preload="auto">
			<source src="/wenzi/media/bg.mp3" type="audio/mpeg" />
			<source src="/wenzi/media/bg.ogg" type="audio/ogg" />
		</audio>
		<audio id="piaBGM" preload="auto">
			<source src="/wenzi/media/pia.mp3" type="audio/mpeg" />
			<source src="/wenzi/media/pia.ogg" type="audio/ogg" />
		</audio>
		<audio id="cryBGM" preload="auto">
			<source src="/wenzi/media/cry.mp3" type="audio/mpeg" />
			<source src="/wenzi/media/cry.ogg" type="audio/ogg" />
		</audio>
		<audio id="crySBGM" preload="auto">
			<source src="/wenzi/media/crys.mp3" type="audio/mpeg" />
			<source src="/wenzi/media/crys.ogg" type="audio/ogg" />
		</audio>
		<input type="hidden" id="device" value="<?php echo $device?>">
		<!-- Game module -->
		<div id="game-container">
			<canvas id="game-body"></canvas>
			<div id="game-notice">打开音效效果更佳哦！</div>
			<ul id="game-menu">
				<li class="play"><img src="/wenzi/img/btn_play.png" alt="开始游戏" /></li>
				<li data-href="/mosquito/top"><img src="/wenzi/img/btn_ranking_y.png" alt="排行榜" /></li>
				<li data-href="/mosquito/gift"><img src="/wenzi/img/btn_gift_r.png" alt="奖品" /></li>
			</ul>
			<div id="game-input">
				<img src="/wenzi/img/nickname_input.png" alt="输入宝宝昵称" />
				<input type="text" name="name" value=" " maxlength="6" />
				<a class="cancel"></a>
				<a class="submit"></a>
			</div>
			<div id="game-result">
				<img src="/wenzi/img/game_result.png" alt="真可惜！宝宝不小心被蚊子叮到啦！" />
				<section>
					<p><span class="nickname special"><?php if($user['mosquito_nick_name']) echo $user['mosquito_nick_name']?></span>抵御蚊子进攻<span class="special livetime">360</span>秒！</p>
					<p>累计消灭蚊子<span class="special" id="total_number"></span>只！</p>
					<p>已超过<span class="special" id="proportion"></span>的宝宝！</p>
				</section>
				<ul class="action-list">
					<li><img src="/wenzi/img/btn_replay.png" class="replay" alt="再啪一次" /></li>
					<?php if($device == 'wechat'):?>
					<li data-href="http://mp.weixin.qq.com/s?__biz=MzAxMDc3NDM1Mg==&mid=502325165&idx=1&sn=6714a6393b60f134f2c4ed4c9f4fa1c6&scene=1&srcid=0708biggLktgxE7mE6UX2FS2#wechat_redirect"><img src="/wenzi/img/btn_more.png" alt="啪得更久" /></li>
					<?php else:?>
					<li data-href="http://weibo.com/5928035261/DEl67CJPz?from=page_1006065928035261_profile&wvr=6&mod=weibotime"><img src="/wenzi/img/btn_more.png" alt="啪得更久" /></li>
					<?php endif;?>
					
					<?php if($device == 'wechat'):?>
					<li data-spopup=".share-notice"><img src="/wenzi/img/btn_share.png" alt="炫耀一下" /></li>
					<?php else:?>
					<li id="weibo_data_href" data-href="http://service.weibo.com/share/share.php?url=http%3A%2F%2Fwx.zhishimama.com%2Fmosquito%2Findex&type=button&language=zh_cn&appkey=724579473&title=<?php echo urlencode($share_content)?>&pic=<?php echo urlencode('http://wx.zhishimama.com/wenzi/img/weiboshare.png')?>&searchPic=true&style=simple"><img src="/wenzi/img/btn_share.png" alt="炫耀一下" /></li>
					<?php endif;?>
					<li data-href="/mosquito/top"><img src="/wenzi/img/btn_ranking.png" alt="排行榜" /></li>
				</ul>
			</div>
		</div>
		<header>
			<img src="/wenzi/img/game_title.png" />
			<input type="hidden" id="share_content" value="<?php echo $share_content?>"/>
			<div id="game-score" <?php if($blood == 3):?> class="wx" <?php endif;?>>
				<input id="liveCount" type="hidden" name="liveCount" value="<?php echo $blood?>" />
				<ul class="clear">
					<li id="mosquitos">0</li>
					<li id="time">0</li>
					<li id="live">
						<span>&nbsp;</span>
						<span>&nbsp;</span>
						<span>&nbsp;</span>
						<?php if($device == 'wechat'):?>
						<span class="help" data-href="http://mp.weixin.qq.com/s?__biz=MzAxMDc3NDM1Mg==&mid=502325165&idx=1&sn=6714a6393b60f134f2c4ed4c9f4fa1c6&scene=1&srcid=0708biggLktgxE7mE6UX2FS2#wechat_redirect">&nbsp;</span>
						<?php else:?>
						<span class="help" data-href="http://weibo.com/5928035261/DEl67CJPz?from=page_1006065928035261_profile&wvr=6&mod=weibotime">&nbsp;</span>
						<?php endif;?>
						
					</li>
				</ul>
			</div>
			<p class="nickname" id="mosquito_nick_name"><?php if($user['mosquito_nick_name']) echo $user['mosquito_nick_name']?></p>
		
		</header>
		<div class="partner">
			<img data-href="http://www.zhishimama.com" src="/wenzi/img/logo.png" />
		</div>
		<div class="popup-wrapper share-notice">
			<div class="popup-bg" data-cpopup=".share-notice"></div>
			<div class="popup-layout" data-cpopup=".share-notice">
				<img class="share" src="/wenzi/img/share_notice.png" />
			</div>
		</div>

		<div class="popup-wrapper showTimeout">
			<div class="popup-layout">
				<img src="/wenzi/img/t_3.png" />
				<img src="/wenzi/img/t_2.png" />
				<img src="/wenzi/img/t_1.png" />
				<p><img src="/wenzi/img/txt_rule.png" /></p>
			</div>
		</div>

	</div>
	<script src="/wenzi/js/game.js?<?php echo time();?>"></script>
	<?php if($device == 'wechat'):?>
	<script type="text/javascript">
    Zepto(function ($) {
        wx.config({
            debug: false,
            appId: '<?php echo $js_config['appId']?>',
            timestamp: <?php echo $js_config['timestamp']?>,
            nonceStr: '<?php echo $js_config['noncestr']?>',
            signature: '<?php echo $js_config['signature']?>',
            jsApiList: [
            	'onMenuShareTimeline',
            	'onMenuShareAppMessage'
            ]
        });
        wx.ready(function () {
        	wx.onMenuShareTimeline({
            	title: '<?php echo $share_content;?>',
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	        $.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 1},
        				type: "post",
        				success: function(res){
        					$(".share-notice").hide();
        					$(".share-notice").siblings().removeClass("disableClick");
        					$("body").css("overflow-y", "auto");
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    	$(".share-notice").hide();
        	    	$(".share-notice").siblings().removeClass("disableClick");
        	    	$("body").css("overflow-y", "auto");
        	    }
        	});

        	wx.onMenuShareAppMessage({
            	title: '<?php echo $share_desc?>',
        	    desc: '<?php echo $share_content;?>', // 分享描述
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    type: 'link', // 分享类型,music、video或link，不填默认为link
        	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	    	$.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 1},
        				type: "post",
        				success: function(res){
        					$(".share-notice").hide();
        					$(".share-notice").siblings().removeClass("disableClick");
        					$("body").css("overflow-y", "auto");
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    	$(".share-notice").hide();
        	    	$(".share-notice").siblings().removeClass("disableClick");
        	    	$("body").css("overflow-y", "auto");
        	    }
        	});
        });
    })
	</script>
	<?php endif;?>
</body>
</html>